home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / ref / unix / monitor < prev    next >
Encoding:
Text File  |  1992-08-27  |  4.5 KB  |  158 lines

  1. .\" XXX standard disclaimer belongs here....
  2. .\" $Header: /private/postgres/ref/unix/RCS/monitor,v 1.14 1992/07/14 05:54:17 ptong Exp $
  3. .SP MONITOR UNIX 6/14/90
  4. .XA 1 "Terminal Monitor"
  5. .uh NAME
  6. .lp
  7. monitor \*- run the interactive terminal monitor
  8. .uh SYNOPSIS
  9. .lp
  10. .(l
  11. \fBmonitor\fP [-h hostname] [-p port] [-t tty_device] [-N] [-T]
  12.     [-c query] [-d path] [-q] [-o options] dbname
  13. .)l
  14. .uh DESCRIPTION
  15. .lp
  16. The interactive terminal monitor is a simple frontend to \*(PP.
  17. It enables one to formulate, edit and review queries before
  18. issuing them to \*(PP.
  19. If changes must be made,
  20. a \*(UU editor may be called
  21. called to edit the
  22. .b "query buffer" ,
  23. which the terminal monitor manages.
  24. The editor used is determined by the value of
  25. the
  26. .A EDITOR
  27. environment variable.
  28. If
  29. .A EDITOR
  30. is not set, then
  31. .b vi
  32. is used by default.
  33. .sp
  34. The terminal monitor requires that the postmaster be running, and the ports
  35. (specified with the "-p" option or by the PGPORT environment variable)
  36. must be identical to those specified to the postmaster.
  37. .uh "COMMAND OPTIONS"
  38. .lp
  39. \fI-h host\fR specifies host machine on which the \*(PP backend
  40. is running; default is your local machine (localhost).
  41. .sp
  42. \fI-p port\fR specifies the well known TCP/IP port used for network 
  43. communication between the terminal monitor and the postmaster.
  44. .sp
  45. \fI-t tty_device\fR specifies the path name to the tty device (or regular
  46. UNIX file) which you want the backend debugging messages to be sent to;
  47. default is /dev/null. 
  48. \fI-N\fR specifies that query results will be dumped to the screen without
  49. any attempt at formatting.  This is useful in conjunction with the
  50. .b -c
  51. option in shell scripts.
  52. .sp
  53. \fI-T\fR specifies that attribute names will not be printed - only the
  54. data itself.  This is useful in conjunction with the 
  55. .b -c
  56. option in shell scripts.
  57. .sp
  58. \fI-c query\fR specifies that the monitor is to run one query and exit.
  59. This is useful for shell scripts, typically in conjunction with the
  60. .b -N
  61. and
  62. .b -T
  63. options.  Examples of shell scripts in the \*(PP distribution using 
  64. .b monitor -c
  65. are createdb, destroydb, createuser, and destroyuser.
  66. .sp
  67. \fI-d path\fR specifies the path name of the file or tty which you want
  68. the frontend debugging messages to be written to; the default is not
  69. to generate any debugging messages. 
  70. .sp
  71. \fI-q\fR specifies that the monitor should do its work quietly.
  72. By default,
  73. it prints welcome and exit messages
  74. and the queries it sends to the backend.
  75. If the \fI-q\fP flag is used,
  76. none of this happens.
  77. .sp
  78. \fI-o options\fR specifies additonal options for the \*(PP backend.
  79. This is only intended for use by \*(PP developers.
  80. .lp
  81. You may set environment variables to avoid typing the above options.
  82. See the \fBENVIRONMENT VARIABLES\fR section below.
  83. .uh "MESSAGES AND PROMPTS"
  84. .lp
  85. The terminal monitor gives a variety of messages to keep the user informed
  86. of the status of the monitor and the query buffer.
  87. .sp
  88. When the terminal monitor is executed,
  89. it gives the current date and time,
  90. usually followed by the information in the
  91. .b dayfile
  92. (files).
  93. .sp
  94. The terminal monitor displays two kinds of messages:
  95. .nf
  96.  
  97. go        The query buffer is empty and the terminal monitor is ready
  98.         for input.  Anything typed will be added to the buffer.
  99.  
  100. *        This prompt is typed at the beginning of each line when the
  101.         terminal monitor is waiting for input.
  102. .sp
  103. .uh "TERMINAL MONITOR COMMANDS"
  104. .nf
  105. .sp
  106.  \\e        Enter the editor to edit the query buffer
  107.  
  108.  \\g        Submit query buffer to \*(PP for execution
  109.  
  110.  \\h        Get on-line help
  111.  
  112.  \\i \fIfilename\fR    Include the file filename into the query buffer
  113.  
  114.  \\p        Print contents of the query buffer 
  115.  
  116.  \\q        Exit from the terminal monitor
  117.  
  118.  \\r        Reset (clear) the query buffer
  119.  
  120.  \\s        Escape to a \*(UU subshell.  To return to the
  121.         terminal monitor, type \*(lqexit\*(rq at the shell prompt.
  122.  
  123.  \\t        Print current time
  124.  
  125.  \\w \fIfilename\fR    Store the query buffer to an external file
  126.  
  127.  \\\\        Produce a single backslash at the current location in query buffer
  128. .sp
  129. .uh "ENVIRONMENT VARIABLES"
  130. .lp
  131. You may set environment variables to avoid specifying command line
  132. options.  These are as follows:
  133. .sp
  134. .(l
  135. hostname:    PGHOST
  136. port:        PGPORT
  137. tty:        PGTTY
  138. options:        PGOPTION
  139. .)l
  140. .sp
  141. .lp
  142. If PGOPTION is specified, then the options it contains are
  143. parsed
  144. .i before
  145. any command-line options.
  146. .uh "RETURN VALUE"
  147. .lp
  148. When executed with the
  149. .b -c query
  150. option
  151. .i monitor
  152. returns 0 to the shell on successful query completion, 1 otherwise.
  153. .sp
  154. .uh "SEE ALSO"
  155. .lp
  156. backend(unix), postmaster(unix), createdb(unix), destroydb(unix),
  157. createuser(unix), destroyuser(unix).
  158.